#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface DBAccurateAsyncTask : NSObject

/// 延迟执行任务
/// - Parameters:
///   - task: 任务详情
///   - delay: 等待时间
///   - queue: 执行线程
+(DBAccurateAsyncTask *)asyncTask:(dispatch_block_t)block afterDelay:(uint64_t)delay queue:(dispatch_queue_t)queue;

/// 取消任务
-(void)cancelTask;

+(void)msleep:(uint64_t)delay;

-(void)sleepDelay:(uint64_t)delay;

+(void)usleep:(uint64_t)delay;

+(void)msleepTo:(uint64_t)timeVal delay:(uint64_t)delay;

+(DBAccurateAsyncTask *)timer:(dispatch_block_t)block rightOff:(BOOL)rightOff repeatCount:(int)repeatCount afterDelay:(uint64_t)delay queue:(dispatch_queue_t)queue;

@end

NS_ASSUME_NONNULL_END
